// Copyright 2011 Jefferson Willian
// willmont7@gmail.com

#include <cstdio>

int main() {
  int n;
  int farm[2][2];                   // Coordenadas da fazenda
  int meteor[2];                      // Coordenadas do meteoro
  int count;
  int games = 1;

  while (scanf("%d%d%d%d", &farm[0][0], &farm[0][1], &farm[1][0], &farm[1][1]) && farm[0][0]) {
    scanf("%d", &n);

    count = 0;

    for (int i = 0;i < n;i++) {
      scanf("%d%d", &meteor[0], &meteor[1]);
      if (meteor[0] <= farm[1][0] && meteor[0] >= farm[0][0] && meteor[1] <= farm[0][1] && meteor[1] >= farm[1][1])
        count++;
    }

    printf("Teste %d\n%d\n\n", games++, count);
  }

  return 0;
}

